package org.i1510.common.service.impl;

import java.net.Proxy;
import java.util.HashMap;
import java.util.Map;

import javax.ws.rs.client.Client;

import org.apache.cxf.binding.soap.saaj.SAAJInInterceptor;
import org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor;
import org.apache.cxf.frontend.ClientProxy;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
import org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor;
import org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor;
import org.apache.ws.security.WSConstants;
import org.apache.ws.security.handler.WSHandlerConstants;
import org.i1510.common.service.ICxf4UserInfoService;
import org.junit.Test;


public class Cxf4UserInfoImpl implements ICxf4UserInfoService{

	public String checkUserInfo(String userName,String userPw) {
		return userName + " say: Hello World! I server! " + userPw;
	}

	@Test
	public  void ClientTest() {
		System.out.println(System.getProperty("java.endorsed.dirs"));
		 JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();  
	        factory.setServiceClass(ICxf4UserInfoService.class);  
	        factory.setAddress("http://172.18.20.94:8080/wuyo/cxf/iCxf4UserInfo?wsdl");  
	        ICxf4UserInfoService helloworld = (ICxf4UserInfoService) factory.create();  
	        System.out.println(helloworld.checkUserInfo("你是我的", "aa123a")); 

	}
	
	
}